import Parse from '@/orms/_init';

export enum sexEnum {
  '女' = 0,
  '男'
}

export default class Friend extends Parse.Object {
  constructor () {
    super('Friend');
  }

  static apis = function (): any { return apis; };

  email: string;

  username: string;

  nickname: string;

  age: number;

  phone: number; // TODO: make its regex

  sex: sexEnum.女 | sexEnum.男;
  // ...to be continued
}

type newFriendPayloadType = {

};

const apis = {
  async createFriend (newFriendPayload: newFriendPayloadType) {
    // let friend = new Friend();

    // friend.set('email', 'test@test.com')
    // friend.set('name', 'tester')
    // friend.set('nickname', 'nickname')
    // friend.set('phone', '13000000000')
    // friend.set('sex', sexEnum.男)

    // await friend.save().catch((error: Error) => error);
    // console.info('friend', friend);
  }
}
